package com.alisls.demo.springcloud.service.im.web;

import com.alisls.demo.springcloud.service.im.service.RabbitMqMessageService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 描述信息
 *
 * @author Ke Wang
 * @date 2020/10/14
 */
@RestController
@RequestMapping("/rabbitMqMessageWeb")
public class RabbitMqMessageWeb {

    @Resource(name = "rabbitMqMessageService")
    private RabbitMqMessageService rabbitMqMessageService;

    @RequestMapping("/sendMessage/{message}")
    public String sendMessage(@PathVariable String message) {
        return rabbitMqMessageService.sendMessage(message);
    }

    @RequestMapping("/sendMessageToImQueue/{message}")
    public String sendMessageToImQueue(@PathVariable String message) {
        return rabbitMqMessageService.sendMessage("imQueue", message);
    }

    @RequestMapping("/sendMessageToImExchangeAndImQueue/{message}")
    public String sendMessageToImExchangeAndImQueue(@PathVariable String message) {
        return rabbitMqMessageService.sendMessage("imExchange", "imQueue", message);
    }

}
